/**
 * @see[微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/setNavigationBarColor.html)
 */
export default function set_nav_bar_color(frontColor: '#ffffff' | '#000000', backgroundColor: string, animation?: { duration?: number; timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' }) {
	return new Promise<boolean>((resolve, reject) => {
		wx.setNavigationBarColor({
			animation,
			backgroundColor,
			frontColor,
			success() {
				resolve(true);
			},
			fail(res) {
				reject(res.errMsg);
			}
		});
	});
}
